superstrict

framework BRL.Blitz

import "TConsole.bmx"

setGraphicsDriver(GLMax2DDriver());
try

	graphics(800, 600, 0, 85);

catch e:object

	throw "Could not initialize video mode.";

end try

setMaskColor(0, 0, 0);
setColor(0, 0, 0);
setBlend(ALPHABLEND);

global con:TConsole = new TConsole;

function cmdCmdList(parms:string[])

	con.cmdListCommands();

end function

function cmdClearConsole(parms:string[])

	con.cmdClearConsole(parms);

end function

function cmdEcho(parms$[])

	con.cmdEcho(parms);

end function

function cmdDumpConsole(parms:string[])

	con.cmdDumpConsole(parms);

end function

function cmdExecFile(parms:string[])

	con.cmdExecFile(parms);

end function

con.AddCommand("cmdlist", "cmdlist - List all available commands.", cmdCmdList);
con.AddCommand("clear", "clear [active|passive] - Clears both consoles, unless one is specified.", cmdClearConsole);
con.AddCommand("echo", "echo text - Echo text to console.", cmdEcho);
con.AddCommand("dumpconsole", "dumpconsole - Dumps console text to 'ConsoleDump.txt'.", cmdDumpConsole);
con.AddCommand("exec", "exec <filename> - Executes a console script file.", cmdExecFile);
con.init(300, 100);

while (not appTerminate())

	setClsColor(128, 128, 128);
	cls();
	con.update();
	flip();

end while
